package com.zline.foodraise.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by heshantao on 15/7/22.
 * 图片
 */
public class PictureBean implements Parcelable{
    //标识是否主图
    int isMain;
    //图片Id
    long pictureId;
    //图片Url地址
    String pictureUrl;

    public PictureBean() {
    }

    public PictureBean(int isMain, long pictureId, String pictureUrl) {
        this.isMain = isMain;
        this.pictureId = pictureId;
        this.pictureUrl = pictureUrl;
    }

    public int getIsMain() {
        return isMain;
    }

    public void setIsMain(int isMain) {
        this.isMain = isMain;
    }

    public long getPictureId() {
        return pictureId;
    }

    public void setPictureId(long pictureId) {
        this.pictureId = pictureId;
    }

    public String getPictureUrl() {
        return pictureUrl;
    }

    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(isMain);
        dest.writeLong(pictureId);
        dest.writeString(pictureUrl);

    }

    public static final Creator<PictureBean> CREATOR = new Creator<PictureBean>() {
        public PictureBean createFromParcel(Parcel in) {
            return new PictureBean(in);
        }

        public PictureBean[] newArray(int size) {
            return new PictureBean[size];
        }
    };


    private PictureBean(Parcel in){
        isMain=in.readInt();
        pictureId=in.readLong();
        pictureUrl=in.readString();
    }
}
